package com.mason.forum.model.vo;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.mason.forum.model.Article;
import com.mason.forum.model.Board;
import com.mason.forum.model.User;
import lombok.Data;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 马拉圈
 * Date: 2023-10-06
 * Time: 22:50
 */
@Data
public class ArticleVO extends Article {
    // 关联对象-作者
    @JsonInclude(JsonInclude.Include.ALWAYS)//保证一定会被序列化
    private User user;

    // 关联对象- 板块
    @JsonInclude(JsonInclude.Include.ALWAYS)//保证一定会被序列化
    private Board board;

    // 作者是否是当前登录用户？
//    @JsonInclude(JsonInclude.Include.ALWAYS)//保证一定会被序列化
    private Boolean own;

    @Override
    public String toString() {
        return "ArticleVO{" +
                "user=" + user +
                ", board=" + board +
                '}' + "  super：" + super.toString();
    }
}
